﻿@model AppsModel.Models.CanvasApp

@{
    ViewBag.Title = "Index";
}
@Scripts.Render("~/Content/js/cajaJS/UserApi.js")
<script>
    window.onscroll = function (oEvent) {
        var canvas = document.getElementById('canvas');
        canvas.contentWindow.scrollTo(0, 1300);
    }
</script>
@{
    int w= @Model.canvasWidth - 20;
    string canvasWidth = w.ToString() + "px"; 
}
<form id="canvasForm" target="canvas" method="post" action="@Model.url">
    <input type="hidden" name="userId" id="userId"/>
</form>
<div style='width: @canvasWidth; height: @Model.canvasHeight; overflow: hidden;'>
    <iframe name="canvas" style="width:100%;" width="100%" height="@Model.canvasHeight" frameBorder="0" sandbox="allow-forms allow-scripts"></iframe>
</div>
<script type="text/javascript">
    var x = getUserId();
    document.getElementById("userId").value = getUserId();
    document.getElementById("canvasForm").submit();
</script>
